<%@ page import="edu.hawaii.kukui.Activity" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <g:set var="entityName" value="${message(code: 'activity.label', default: 'Activity')}"/>
  <title><g:message code="default.show.label" args="[entityName]"/></title>
</head>
<body>

<div class="body">
  <h1>Activity Detail</h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <div class="dialog">
    <table>
      <tbody>

      <tr class="prop">
        <td valign="top" class="name"><div class="txtaright"><g:message code="activity.title.label" default="Title:"/></div></td>

        <td valign="top" class="value">${fieldValue(bean: activityInstance, field: "title")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><div class="txtaright"><g:message code="activity.description.label" default="Description:"/></div></td>

        <td valign="top" class="value">${fieldValue(bean: activityInstance, field: "description")}</td>

      </tr>

      <g:if test= "${activityInstance.activityType == 'Event'}">
      <tr class="prop">
        <td valign="top" class="name"><div class="txtaright"><g:message code="activity.eventDate.label" default="Event Date:"/></div></td>
        <td valign="top" class="value"><g:formatDate date="${activityInstance?.eventDate}"/></td>
      </tr>
      </g:if>

      <tr class="prop">
        <td valign="top" class="name"><div class="txtaright"><g:message code="activity.expectedDuration.label" default="Expected Duration (minutes):"/></div></td>

        <td valign="top" class="value">${fieldValue(bean: activityInstance, field: "expectedDuration")}</td>

      </tr>

      <tr class="prop">
        <td valign="top" class="name"><div class="txtaright"><g:message code="activity.kukuiNuts.label" default="Kukui Nuts:"/></div></td>

        <td valign="top" class="value">${fieldValue(bean: activityInstance, field: "kukuiNuts")}</td>

      </tr>

      </tbody>
    </table>
  </div>
  <div class="buttons">
    <g:form>
      <g:hiddenField name="id" value="${activityInstance?.id}"/>
      <g:if test="${activityInstance.verificationType == 'Upload_Image'}">
        <span class="button"><g:actionSubmit class="create" action="saveNewImageAttempt" value="Select Activity"/></span>
      </g:if>
      <g:if test="${activityInstance.verificationType == 'Text_Field'}">
        <span class="button"><g:actionSubmit class="create" action="saveNewTextAttempt" value="Select Activity"/></span>
      </g:if>
      <g:if test="${activityInstance.verificationType == 'Confirmation_Code'}">
        <span class="button"><g:actionSubmit class="create" action="saveNewCodeAttempt" value="Select Activity"/></span>
      </g:if>

    </g:form>
  </div>
</div>
</body>
</html>
